document.write("<DOWNLOAD ID=\"Calendardwn\" STYLE=\"behavior:url(#default#download)\" />");

var showTime=false;
var oCalendarPopup = window.createPopup();
var CalendarIsDown=false;
var theDataObj;

function onCalendarDone(src)
{
	oCalendarPopup.document.write(src);
}

function showCalendarPopup(theDataObje,showTime)
{
	var iHeight=190;
	if (showTime)
	{
		iHeight=215;
		oCalendarPopup.document.getElementById("timePanel").style.display="block";
		oCalendarPopup.document.getElementById("oTime").checked=true;
	}
	else
	{
		oCalendarPopup.document.getElementById("timePanel").style.display="none";
		oCalendarPopup.document.getElementById("oTime").checked=false;
	}

	oCalendarPopup.show(0, 20, 180, iHeight, theDataObj);
}


function getDate(DateType,iRelatePub)
{
 var url,top,left,style,DataValue,temp;
 top=window.event.screenY+12;
 left=window.event.screenX-100;
 temp="";

 theDataObj=window.document.getElementById(DateType);

 if (theDataObj==null)
 	 theDataObj=window.document.getElementsByName(DateType)[0];

 if (theDataObj==null)
  return;
 if (theDataObj.className=="ReadOnly")
 		return;
 if (iRelatePub==null)
   iRelatePub=0;
 for (i=1;i<=iRelatePub;i++)
   temp+="../";
 Url=temp+"public/calendar.html";

 showTime=(arguments[2]==null)?false:arguments[2];

 if (!CalendarIsDown)
 {
 		Calendardwn.startDownload(Url,onCalendarDone);
 		CalendarIsDown=true;
  }else  showCalendarPopup(theDataObj,arguments[2]==null?false:arguments[2]);
 
}
function getCurrentDate()
{
    var currDate,strDate;
    var year,month,day;
    currDate = new Date();
    year = currDate.getYear();
    month = currDate.getMonth()+1;
    day = currDate.getDate();
    if(month<10)
        month="0"+month;
    if(day<10)
      day="0"+day;
    strDate = year+"-"+month+"-"+day;
    return strDate;
}
